#include <boost/algorithm/string.hpp>
#include <locale>
#include <iostream>

int main()
{
	std::string s = "David Hilbert";
	std::cout << boost::algorithm::replace_first_copy(s,"i","I") << std::endl;
	std::cout << boost::algorithm::replace_nth_copy(s,"i",0,"I") << std::endl;
	std::cout << boost::algorithm::replace_last_copy(s,"i","I") << std::endl;
	std::cout << boost::algorithm::replace_all_copy(s,"i","I") << std::endl;
	std::cout << boost::algorithm::replace_head_copy(s,5,"Liang") << std::endl;
	std::cout << boost::algorithm::replace_tail_copy(s,7,"Zhang") << std::endl;
}